#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.65])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE([1.0])
LT_INIT([disable-static win32-dll dlopen])

AC_PROG_LIBTOOL
AC_PREFIX_DEFAULT(/cygdrive/e/installdir)

AC_ARG_ENABLE([x11],
[  --enable-x11    Turn on x11],
[case "${enableval}" in
  yes) x11=true ;;
  no)  x11=false ;;
  *) AC_MSG_ERROR([bad value ${enableval} for --enable-x11]) ;;
esac],[x11=false])
AM_CONDITIONAL([WITHOUT_X11], [test x$x11 = xtrue])


AC_ARG_ENABLE([release],
[  --enable-release    build debug or release],
[case "${enableval}" in
  yes) release=true ;;
  no)  release=false ;;
  *) AC_MSG_ERROR([bad value ${enableval} for --enable-release]) ;;
esac],[release=false])
AM_CONDITIONAL([DEBUG], [test x$release = xfalse])
AM_CONDITIONAL([RELEASE], [test x$release = xtrue])

AC_ARG_ENABLE([x64],
[  --enable-x64    build x86 or x64],
[case "${enableval}" in
  yes) x64=true ;;
  no)  x64=false ;;
  *) AC_MSG_ERROR([bad value ${enableval} for --enable-x64]) ;;
esac],[x64=false])
AM_CONDITIONAL([X86], [test x$x64 = xfalse])
AM_CONDITIONAL([X64], [test x$x64 = xtrue])

CFLAGS=
AS_IF([test x$release = xfalse], [CFLAGS+=" -O2 -g"],
    [test x$release = xtrue], [CFLAGS+=" -O3 -DNDEBUG"],
    [])
AS_IF([test x$x64 = xfalse], [CFLAGS+=" -m32"],
    [test x$x64 = xtrue], [CFLAGS+=" -m64"],
    [])

# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB

# Checks for libraries.
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [main])

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_FILES([Makefile
                 font/devX100/Makefile
                 foo/Makefile
                 foo1/Makefile
                 foo2/Makefile
                 foo2/foo2-1/Makefile
                 src/Makefile
                 testmain/Makefile])
AC_OUTPUT
